package com.dongdongshop.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.dongdongshop.mapper.seller.TbSpecificationOptionMapper;
import com.dongdongshop.pojo.seller.TbSpecificationOption;
import com.dongdongshop.pojo.seller.TbSpecificationOptionExample;
import com.dongdongshop.service.SpecificationOptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Service
@Component
public class SpecificationOptionServiceImpl implements SpecificationOptionService {

    @Autowired
    private TbSpecificationOptionMapper specificationOptionMapper;

    @Override
    public List<TbSpecificationOption> findOptionsById(Long id) {
        TbSpecificationOptionExample example = new TbSpecificationOptionExample();
        TbSpecificationOptionExample.Criteria criteria = example.createCriteria();
        criteria.andSpecIdEqualTo(id);
        return specificationOptionMapper.selectByExample(example);
    }
}
